<template>
  <div class="login">
    <div class="title">水库数字孪生管理平台</div>
    <div class="form">
      <div class="inputdiv">
        <el-input
          v-model="data.form.usename"
          style="width: 100%; height: 100%"
          size="large"
          placeholder="请输入用户名"
          class="input-border-style frontimg2"
          type="text"
        >
        </el-input>
      </div>
      <div class="inputdiv">
        <el-input
          v-model="data.form.password"
          style="width: 100%; height: 100%"
          size="large"
          placeholder="请输入密码"
          class="input-border-style frontimg2"
          autocomplete="new-password"
          type="text"
        ></el-input>
      </div>
      <div class="inputdiv inputdiv2">
        <el-input
          v-model="data.form.umd"
          style="width: 60%; height: 100%"
          size="large"
          placeholder="验证码"
          autocomplete="new-password"
          type="text"
          class="frontimg3 input-border-style"
        ></el-input>
        <el-image style="width: 35%; height: 100%" src="" class="captcha-img" />
      </div>

      <div class="inputdiv">
        <el-button
          @click="pushrouter"
          color="#46A5D9"
          style="width: 100%; height: 100%"
          >登录</el-button
        >
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, reactive } from "vue";
import { useRouter } from "vue-router";
const router = useRouter();
let data = reactive({
  form: {
    usename: "",
    password: "",
    umd: "",
  },
});
const pushrouter = () => {
  router.push("/home");
  localStorage.setItem("token", JSON.stringify("后端生成的Token"));
  localStorage.setItem("tokenStartTime", new Date().getTime()); //  存储token开始时间
};
</script>

<style lang="scss" scoped>
.login {
  width: 100%;
  height: 100vh;
  position: absolute;
  top: 0px;
  left: 0px;
  overflow: hidden;
  background: url("@/assets/image/loginback.png") 0px 0px no-repeat;
  background-size: cover;
  .title {
    font-family: "HuXiaoBo-NanShen";
    font-weight: 600;
    font-size: 50px;
    color: #ffffff;
    // line-height: 0px;
    letter-spacing: 10px;
    text-align: center;
    font-style: normal;
    text-transform: none;
    margin-top: 145px;
  }
  .form {
    width: 443px;
    height: 396px;
    position: absolute;
    top: 369px;
    right: 299px;
    background: url("@/assets/image/z48.png") 0px 0px no-repeat;
    background-size: cover;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 17px;
    .inputdiv {
      width: 275px;
      height: 41px;
      background: transparent;
      //   border-radius: 0px 0px 0px 0px;
      //   border: 1px solid #46a5d9;
    }
    .inputdiv2 {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
  }
}
::v-deep {
  .frontimg .el-input__inner {
    background: url("@/assets/image/username.png") no-repeat 10px center;
    padding: 0px 50px; /*输入内容左右边距控制*/
    color: #ffffff;
  }
  .frontimg2 .el-input__inner {
    background: url("@/assets/image/lock.png") no-repeat 10px center;
    padding: 0px 50px; /*输入内容左右边距控制*/
    color: #ffffff;
    // background: transparent;
  }
  .frontimg3 .el-input__inner {
    color: #ffffff;
  }
  .el-button {
    border-radius: 0px;
    font-family: SimHei, SimHei;
    font-weight: 400;
    font-size: 20px;
    color: #ffffff;
    // line-height: 0px;
    letter-spacing: 2px;
    // text-align: left;
    font-style: normal;
    text-transform: none;
  }
}
</style>